class EndingBeh extends ps.Behaviour {
  /** 序列化 */
  private serializableFields: Object = {};
  constructor(gameObject: qc.Node) {
    super(gameObject);
  }
  /**
   * 显示结束界面
   * @param result 结果，默认为true
   */
  onEnd(result: boolean = true) {
    main.gameObject.getChild('group_btn_download').visible = false
    if (main.enemies.length === 0) {
      ps.Audio.changeBg("bgm_ending_success", "ending");
      this.gameObject.getChild("success").visible = true;
      this.gameObject.getChild("successView").visible = true
    } else {
        ps.Audio.changeBg("bgm_ending_defeate", "ending");
      this.gameObject.getChild("defeat").visible = true;
    }
  }
}
qc.registerBehaviour("EndingBeh", EndingBeh);
